package top.vanchor.flexible.utils;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSON;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;

public class JsonUtils {
//    public static JSONArray getAreaJson() {
//        String path = "/area.json";
//        InputStream config = JsonUtils.class.getResourceAsStream(path);
//
//        if (config == null) {
//            throw new RuntimeException("读取文件失败");
//        } else {
//            try (BufferedReader reader = new BufferedReader(new InputStreamReader(config, StandardCharsets.UTF_8))) {
//                String jsonText = reader.lines().collect(Collectors.joining(System.lineSeparator()));
//                JSONArray json = JSON.parseArray(jsonText);
//                return json;
//            } catch (Exception e) {
//                throw new RuntimeException("解析文件失败", e);
//            }
//        }
//    }
}
